﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows;
using SongSharp.Appliance;
using SongSharp.Presentation.View;
using SongSharp.Presentation.Command;

namespace SongSharp.Presentation.ViewModel
{
    public class WaitViewModel : ViewModelBase
    {
        private WaitView WaitView { get; set; }
        private PrimeViewModel PrimeModel { get; set; }
        private Window Owner { get; set; }

        public WaitViewModel(PrimeViewModel primeModel, Window owner)
        {
            PrimeModel = primeModel;
            Owner = owner;
        }

        public void ShowWindow(string message)
        {
            if (WaitView == null || !WaitView.IsLoaded)
            {
                WaitView = new WaitView(message);
                WaitView.DataContext = this;
                WaitView.Owner = Owner;
                WaitView.ShowDialog();
            }
            else
            {
                WaitView.Activate();
            }
        }

        public void Close()
        {
            WaitView.Close();
        }
    }
}
